package novel.manager.service.utils;

import novel.manager.pojo.spider.NovelSiteEnum;
import novel.manager.service.iface.spider.chapter.IChapterDetailSpider;
import novel.manager.service.impl.spider.chapter.DefaultChapterDetailSpider;


public final class ChapterDetailSpiderFactory {
	private ChapterDetailSpiderFactory() {}
	/**
	 * 通过给定的url拿到实现了IChapterDetailSpider的具体实现类DefaultChapterDetailSpider
	 */
	//url:章节页面
	public static IChapterDetailSpider getChapterDetailSpider(String url) {
		IChapterDetailSpider spider = null;
		NovelSiteEnum novelSiteEnum = NovelSiteEnum.getEnumByUrl(url);
		switch (novelSiteEnum) {
		case DingDianXiaoShuo :
		case BiQuGe :
		case KanShuZhong :
		case Bxwx :
			spider = new DefaultChapterDetailSpider();
			break;
		}
		return spider;
	}
}
